(function() {
  var Article, Async, Reflection, viewDataHandler;

  Async = require('async');

  Article = require('./article');

  Reflection = require('./reflection');

  viewDataHandler = {
    /**
     * [home description]
     * @param  {[type]} cbf [description]
     * @return {[type]}     [description]
    */

    home: function(cbf) {
      return Async.series({
        welcomeDialogContent: function(cbf) {
          return Reflection.findOne(function(err, data) {
            if (err) {
              return cbf(err);
            } else {
              return cbf(null, data);
            }
          });
        },
        articlesContent: function(cbf) {
          return Article.findAll(function(err, data) {
            if (err) {
              return cbf(err);
            } else {
              return cbf(null, data);
            }
          });
        }
      }, function(err, results) {
        return cbf(err, results);
      });
    }
  };

  module.exports = viewDataHandler;

}).call(this);
